Skip to content

[ENH] improved simple assertion error message in evalutation/functions.py#1600

Merged
fkiraly merged 7 commits intoopenml:mainfrom
EmanAbdelhaleem:slight_fix
Feb 15, 2026
Merged

[ENH] improved simple assertion error message in evalutation/functions.py#1600
fkiraly merged 7 commits intoopenml:mainfrom
EmanAbdelhaleem:slight_fix

Conversation

@EmanAbdelhaleem
Copy link
Contributor

@EmanAbdelhaleem EmanAbdelhaleem commented Jan 6, 2026

Details

fixed a simple assertion error message in evalutation/functions.py

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.07%. Comparing base (5b85b77) to head (898d89f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1600      +/-   ##
==========================================
+ Coverage   44.44%   52.07%   +7.63%     
==========================================
  Files          36       36              
  Lines        4351     4351              
==========================================
+ Hits         1934     2266     +332     
+ Misses       2417     2085     -332     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fkiraly fkiraly changed the title [ENH] A slight fix to an assertion error message [ENH] improved simple assertion error message in evalutation/functions.py Jan 6, 2026
Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this PR related to #1574?

Comment on lines 234 to 236
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), type(
evals_dict["oml:evaluations"],
evals_dict["oml:evaluations"]["oml:evaluation"],
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I got what you mean, should I change something or not?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertion message can be improved like this:

"Expected 'oml:evaluations.oml:evaluation' to be a list, but got ..."

@EmanAbdelhaleem
Copy link
Contributor Author

How is this PR related to #1574?

It's not. It's a slight mistake I found while reading the code for evaluation functions

Copy link
Collaborator

@geetu040 geetu040 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

CC: @fkiraly @SimonBlanke for review/merge.

Comment on lines 234 to 237
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), (
"Expected 'oml:evaluation' to be a list, but got"
)
f"{type(evals_dict['oml:evaluations']['oml:evaluation']).__name__}. "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), (
"Expected 'oml:evaluation' to be a list, but got"
)
f"{type(evals_dict['oml:evaluations']['oml:evaluation']).__name__}. "
assert isinstance(evals_dict["oml:evaluations"]["oml:evaluation"], list), (
"Expected 'oml:evaluation' to be a list, but got"
f"{type(evals_dict['oml:evaluations']['oml:evaluation']).__name__}. "
)

@fkiraly fkiraly merged commit aba2586 into openml:main Feb 15, 2026
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants